import 'package:azlistview/azlistview.dart';
import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/buyer_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class BuyerEntity extends ISuspensionBean {
  late String userId;
  late String nickname;

  String? tagIndex;
  String? namePinyin;

  bool isSelect = false;

  BuyerEntity();

  @override
  String getSuspensionTag() => tagIndex!;

  factory BuyerEntity.fromJson(Map<String, dynamic> json) => $BuyerEntityFromJson(json);

  Map<String, dynamic> toJson() => $BuyerEntityToJson(this);

  @override
  String toString() => json.encode(this);

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is BuyerEntity &&
          runtimeType == other.runtimeType &&
          userId == other.userId &&
          nickname == other.nickname;

  @override
  int get hashCode => userId.hashCode ^ nickname.hashCode;
}
